package com.ledict.casefiling.action;

import com.ledict.casefiling.entity.SysDict;
import com.ledict.casefiling.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cache")
public class CacheTestController {
    @Autowired
    private RedisUtils redisUtils;

    @GetMapping("/{id}")
    public SysDict query(@PathVariable String id){
        String key = "sys:dict:" + id;
        return (SysDict) redisUtils.get(key);
    }
}
